﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SGT_ON;

public partial class AlertasComerciales : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void dvAlertasEntrega_Load(object sender, EventArgs e)
    {
        if (Profile.MostrarAlertasComerciales == false)
            dvAlertas.Visible = false;
        else
            dvAlertas.Visible = true;
    }
    protected void dsAlertas_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        if (Profile.IdEnSistema <= 0)
        {
            e.Cancel = true;
            dvAlertas.Visible = false;
        }
        else
            dvAlertas.Visible = true;
    }
    protected void dsAlertas_Selected(object sender, ObjectDataSourceStatusEventArgs e)
    {
        SGT_ON.AlertaColeccion _alertas = (AlertaColeccion)e.ReturnValue;

         if ((_alertas == null)
             || (_alertas.Count == 0))
            dvAlertas.Visible = false;
        else
            dvAlertas.Visible = true;
    }
}